#include<stdio.h>
#include<stdlib.h>
#include<glob.h>
#define PAT "/etc/.*"
int main(int argc,char **argv)
{
	glob_t glob_st;
		int i,err;
		err=glob(PAT,0,NULL,&glob_st);
		if(err)
		{
				printf("errro code = %d",err);
				return -1;

		}
		for(i=0;i<glob_st.gl_pathc;i++)
				puts(glob_st.gl_pathv[i]	);
		globfree(&glob_st);
		return 0;
}
